package com.jf.hotelreservation.demos.controller;

import com.jf.hotelreservation.demos.service.PCDService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 省市区处理结果
 */
@RestController
@RequestMapping("/PCD")
public class PCDController {

    @Autowired
    private PCDService pcdService;

    @GetMapping("/province")
    public String province(){
        return pcdService.getProvince();
    }

    @GetMapping("/city")
    public String city(Integer id){
        return pcdService.getCity(id);
    }

    @GetMapping("/area")
    public String area(Integer id){
        return pcdService.getArea(id);
    }
}
